package com.epam.task.oop.medicines;

import com.epam.task.oop.Characters.MedicineCategory;

import java.io.Serializable;

public class Medicament extends Product implements Serializable, Comparable{

    private static final long serialVersionUID = 1L;
    private float dose;
    private MedicineCategory category;

    public Medicament(String name, String manufacturer, String dateSalesStart,
                      int count, float price, int id, float dose, MedicineCategory category) {
        super(name, manufacturer, dateSalesStart, count, price, id);
        this.dose = dose;
        this.category = MedicineCategory.PRESCRIPTION_PRODUCT;
    }

    public float getDose() {
        return dose;
    }

    public void setDose(float dose) {
        this.dose = dose;
    }
    public String toString() {
        String res = "Name: " + this.getName() + ", id: " + this.getId()
                + ", Manufacture: " + this.getManufacturer() + " , Date sales start: " + this.getDateSalesStart()
                + " , " + this.getCount() + " pcs, price: " + this.getPrice()
                + this.getDose() + " ml, category: " + category;
        return res;
    }

    public float countCost() {
       return this.getCount() * this.getPrice();
    }
}
